/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unimelb.distSystems.communications;

import unimelb.distSystems.communications.CORBA.*;

import java.io.Serializable;


public class UserAccount implements Serializable {
    private ClientService callback;
    private long userID;
    private String username;
    private String password;
    private String driverName;
    private byte[] avatar;

    public UserAccount() {
    }

    public UserAccount(long userID, String username, String password, String driverName, byte[] avatar) {
        this.userID = userID;
        this.username = username;
        this.password = password;
        this.driverName = driverName;
        this.avatar = avatar;
    }

    public UserAccount(ServiceAccount account) {
        this.userID = account.userID;
        this.username = account.username;
        this.password = account.password;
        this.driverName = account.driverName;
        this.avatar = account.avatar;
    }

    public ServiceAccount getAccount(){
        ServiceAccount account = new ServiceAccount();
        account.userID = this.userID;
        account.username = this.username;
        account.password = this.password;
        account.driverName = this.driverName;
        account.avatar = this.avatar;
        return account;
    }

    public void generateID(){
        this.userID = username.hashCode();
    }

    public void adjustID(){
        this.userID++;
    }

    public ClientService getCallback() {
        return callback;
    }

    public void setCallback(ClientService callback) {
        this.callback = callback;
    }

    public byte[] getAvatar() {
        return avatar;
    }

    public void setAvatar(byte[] avatar) {
        this.avatar = avatar;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public long getUserID() {
        return userID;
    }

    public void setUserID(long userID) {
        this.userID = userID;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

}
